/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.rafkind.crawl.battle;

import com.rafkind.crawl.data.Creature;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author dave
 */
public class BattleCommand {
  protected Creature source;
  protected List<Creature> targets;

  public BattleCommand(Creature source, List<Creature> targets) {
    this.source = source;
    this.targets = targets;
  }
  
  public BattleCommand(Creature source) {
    this.source = source;
    this.targets = new ArrayList<Creature>();
  }
  
  public BattleResult execute(List<BattleListener> listeners) {
    BattleResult answer = BattleResult.CONTINUE;
    
    for (Creature target : targets) {
      answer.merge(execute(listeners, target));
    }
    
    return answer;
  }
  
  public BattleResult execute(List<BattleListener> listeners, Creature target) {
    return BattleResult.CONTINUE;
  }
}